package com.xdog.okx.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.xdog.okx.service.IOkxTransactionService;
import com.xdog.okx.utils.OkxApiUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * OKX交易数据服务实现类
 * 提供交易相关信息查询功能
 */
@Slf4j
@Service
public class OkxTransactionServiceImpl implements IOkxTransactionService {

    @Override
    public JSONObject getTransactionList(Map<String, String> params) {
        String requestPath = "/api/v5/xlayer/transaction/transaction-list";
        return OkxApiUtil.get(requestPath, params);
    }

    @Override
    public JSONObject getLargeTransactionList(Map<String, String> params) {
        String requestPath = "/api/v5/xlayer/transaction/large-transaction-list";
        return OkxApiUtil.get(requestPath, params);
    }

    @Override
    public JSONObject getUnconfirmedTransactionList(Map<String, String> params) {
        String requestPath = "/api/v5/xlayer/transaction/unconfirmed-transaction-list";
        return OkxApiUtil.get(requestPath, params);
    }

    @Override
    public JSONObject getInternalTransactionDetail(Map<String, String> params) {
        String requestPath = "/api/v5/xlayer/transaction/internal-transaction-detail";
        return OkxApiUtil.get(requestPath, params);
    }

    @Override
    public JSONObject getTokenTransactionDetail(Map<String, String> params) {
        String requestPath = "/api/v5/xlayer/transaction/token-transaction-detail";
        return OkxApiUtil.get(requestPath, params);
    }

    @Override
    public JSONObject getTransactionFills(Map<String, String> params) {
        String requestPath = "/api/v5/xlayer/transaction/transaction-fills";
        return OkxApiUtil.get(requestPath, params);
    }

    @Override
    public JSONObject getTransactionMulti(Map<String, String> params) {
        String requestPath = "/api/v5/xlayer/transaction/transaction-multi";
        return OkxApiUtil.get(requestPath, params);
    }

    @Override
    public JSONObject getInternalTransactionMulti(Map<String, String> params) {
        String requestPath = "/api/v5/xlayer/transaction/internal-transaction-multi";
        return OkxApiUtil.get(requestPath, params);
    }

    @Override
    public JSONObject getTokenTransferMulti(Map<String, String> params) {
        String requestPath = "/api/v5/xlayer/transaction/token-transfer-multi";
        return OkxApiUtil.get(requestPath, params);
    }
}